public class Solution {
    public boolean isSubsequence(String s, String t) {
        int n1 = s.length();
        int n2 = t.length();
        char[] arr1 = s.toCharArray();
        char[] arr2 = t.toCharArray();
        int p1 = 0, p2 = 0;

        while(p1 < n1 && p2 < n2){
            if(arr1[p1] == arr2[p2]){
                p1++;
            }
            p2++;
        }
        return p1 == n1;
    }
}
